<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.*, model.*,board.*" %>

<%@ include file="../common/include/header.jsp" %>

<div style="width: 980px;">
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr>
		<td style="width: 180px;vertical-align: top;background:  #fdb73a;">
			<%@include file="../common/include/leftmenu.jsp" %>
		</td>
			<html:form action="/databoard.do">
		<td style="vertical-align: top;width: 800px;">
			<%@include file="logo.jsp" %>
			<div class="boardname" style="text-align: center;"><bean:write name="dataForm" property="dbname"/></div>			
		
				<input type="hidden" name="method" value="getForm"/>
				<input type="hidden" name="cono" value="<bean:write name="dataForm" property="cono"/>"/>
				<input type="hidden" name="dbname" value="<bean:write name="dataForm" property="dbname"/>"/>								
				
				<table border="0" cellpadding="0" cellspacing="0" width="700px" align="center">					
					<tr style="height: 20px;">
						<td style="width: 50px;background-image: url('<%=imagePath %>boardlist_topbg_01.jpg');" class="fbtd2"></td>
						<td style="width: 100px;background-image: url('<%=imagePath %>boardlist_topbg_02.jpg');" class="fbtd2"></td>
						<td style="background-image: url('<%=imagePath %>boardlist_topbg_03.jpg');" class="fbtd2"></td>
						<td style="width: 100px;background-image: url('<%=imagePath %>boardlist_topbg_04.jpg');" class="fbtd2"></td>
						<td style="width: 50px;background-image: url('<%=imagePath %>boardlist_topbg_05.jpg');" class="fbtd2"></td>

					</tr> 	
					
					<logic:iterate id="list" name="dataForm" property="dataLists">
							<tr id="<bean:write name="list" property="dbno"/>"
								onmouseover="changeBGC(<bean:write name="list" property="dbno"/>)"
								onmouseout="returnBGC(<bean:write name="list" property="dbno"/>)">
								
								<td class="dbLists_td"><bean:write name="list" property="rownum"/></td>
								<td class="dbLists_td">
									<a href="javascript:;" onmousedown="popmenu1('<bean:write name="list" property="mid"/>');" >									
									<bean:write name="list" property="nick"/></a>
								</td>
								<td class="dbLists_td" style="text-align: left;">
									<a href="databoard.do?method=detailview&dbno=<bean:write name="list"property="dbno"/>&rownum=<bean:write name="list" property="rownum"/>">
									<bean:write name="list" property="dbtitle"/>	
			
									<logic:notEmpty name="list" property="originalname">
										<img src="<%=imagePath %>icon_file_s.gif"/>
									</logic:notEmpty>								
									<logic:greaterThan value="0" name="list" property="commentRows">
										<span style="font-size: 7pt;">[<bean:write name="list" property="commentRows"/>]</span>
									</logic:greaterThan>	
									
									<logic:notEmpty name="list" property="ddd">
										<img src="<%=imagePath%>icon_new.gif"/>
									</logic:notEmpty>									
									
									</a></td>
								<td class="dbLists_td"><bean:write name="list" property="dbdate"/></td>
								<td class="dbLists_td"><bean:write name="list" property="dbcounter"/></td></tr>				
	
						</logic:iterate>				  
					
					
					<tr><td colspan="5">
					<!-- 페이징  -->
							<!-- 일반 리스트 페이지--> 
							<logic:empty name="dataForm" property="searchList">
								<jsp:include page="pager.jsp">
									<jsp:param name="url" value="databoard.do?method=getList"/>
								</jsp:include>
							</logic:empty>							
					
							<!-- 아이디 검색 페이지-->
							<logic:notEmpty name="dataForm" property="searchList">
								<logic:match value="mid" name="dataForm" property="searchList">
									<jsp:include page="pager.jsp">
										<jsp:param name="url" value="databoard.do?method=search&data=mid"/>
									</jsp:include>
								</logic:match>
								
								<!-- 제목 검색 페이지 -->
								<logic:match value="dbtitle" name="dataForm" property="searchList">
									<jsp:include page="pager.jsp">
										<jsp:param name="url" value="databoard.do?method=search&data=dbtitle"/>
									</jsp:include>
								</logic:match>
							</logic:notEmpty>
							
						</td></tr>
					<tr><td colspan="5" align="center">
							<!-- 목록 검색 -->											
							
							<html:select property="searchList">
								<html:option value="mid">글쓴이</html:option>
								<html:option value="dbtitle">제목</html:option>								
							</html:select>
							<html:text property="searchData" size="10"></html:text>
							<html:link href="javascript: check('search');"><img src="<%=imagePath %>icon_search.jpg"/></html:link>
								
						</td></tr>	
					<tr><td colspan="5" style="text-align: right;">
							<logic:notEmpty name="dataForm" property="searchList">
								<html:link href="javascript:goList('getList');"><img src="<%=imagePath %>icon_list.jpg"/></html:link>								
							</logic:notEmpty>
							
							<html:link href="javascript:dataForm.submit();"><img src="<%=imagePath %>icon_write.jpg"/></html:link>						
						</td></tr>						
				</table>			
				
		</td>
				
			</html:form>			
	</tr>
</table>
</div>

<%@ include file="../common/include/footer.jsp" %>

<script type="text/javascript">

	function check(m){
		var word = document.dataForm.searchData.value.replace(/\s/g,"");
		if(word==""){
			window.alert("검색할 내용을 입력하시오");
			document.dataForm.searchData.focus();
			return;
		}
		var method = document.getElementById('method');	
		method.value= m;
		dataForm.submit();		
	}
	
	function goList(m){		
		var method = document.getElementById('method');	
		method.value= m;
		dataForm.submit();
			
	}

</script>


